package com.ysd.servlet;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ysd.dao.impl.ProductclassifiCationTableDaoImpl;
import com.ysd.dao.impl.chafenDaoImpl;
import com.ysd.entity.ProductclassifiCationTable;
import com.ysd.entity.Productdetailsinfo;

public class ProductDetailServlet extends HttpServlet {
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		ProductclassifiCationTableDaoImpl cDao = new ProductclassifiCationTableDaoImpl();
		List<ProductclassifiCationTable> list = cDao.gatProductclassifiCationTables();
		request.setAttribute("pc", list);
		
		int productid = Integer.parseInt(request.getParameter("s"));
		chafenDaoImpl pDao = new chafenDaoImpl();
		List<Productdetailsinfo> Productdetailsinfo=pDao.Productdetailsinfo(productid);
		request.setAttribute("p", Productdetailsinfo);
		request.getRequestDispatcher("productdetails.jsp").forward(request, response);
		
		}
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
